<template>
  <el-table
    @row-click="row_click"
    :data="stuctureStore.stuctures"
    highlight-current-row
    default-expand-all
    :row-key="(row) => row._id"
    border
    style="width: 100%"
  >
    <el-table-column align="center" type="index" width="50" />
    <el-table-column align="center" prop="name" label="名称" width="480" />
    <el-table-column align="center" prop="code" label="编号" />
    <el-table-column align="center" prop="fuzename" label="负责人" />
    <el-table-column align="center" prop="pid" label="上级ID" />
    <el-table-column align="center" prop="sortnum" label="排序号" />
    <el-table-column align="center" prop="id" label="ID" />
  </el-table>
</template>

<script lang="ts" setup>
import { useStuctureStore } from "./store.ts";

const stuctureStore = useStuctureStore();

const row_click = (row) => {
  stuctureStore.set_stucture({ ...row });
};
</script>

<style>
.cell {
  color: black;
}
</style>
